<!DOCTYPE HTML>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="author" content="Bootstrap-ecommerce by Vosidiy">

    <title>【管理员】修改用户信息</title>

    <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">

    <!-- jQuery -->
    <script src="/js/jquery-2.0.0.min.js" type="text/javascript"></script>

    <!-- Bootstrap4 files-->
    <script src="/js/bootstrap.bundle.min.js" type="text/javascript"></script>
    <link href="/css/bootstrap.css" rel="stylesheet" type="text/css"/>

    <!-- Font awesome 5 -->
    <link href="/fonts/fontawesome/css/fontawesome-all.min.css" type="text/css" rel="stylesheet">

    <!-- plugin: fancybox  -->
    <script src="/plugins/fancybox/fancybox.min.js" type="text/javascript"></script>
    <link href="/plugins/fancybox/fancybox.min.css" type="text/css" rel="stylesheet">

    <!-- custom style -->
    <link href="/css/ui.css" rel="stylesheet" type="text/css"/>
    <link href="/css/responsive.css" rel="stylesheet" media="only screen and (max-width: 1200px)" />

    <!-- custom javascript -->
    <script src="/js/script.js" type="text/javascript"></script>

    <script type="text/javascript">
        /// some script

        // jquery ready start
        $(document).ready(function() {
            // jQuery code

        });
        // jquery end
    </script>

</head>
<body>
<nav class="navbar navbar-expand-lg navbar-collapse  bg2">
    <form action="/HTML/userInfo" method="post" name="showUserInfoForm" >
        <a class="navbar-brand" href="javascript:history.go(-1)" name="savesubmit" id="savesubmit"> <img class="logo" src="/images/logo-dark.png" th:text="'  '+'管理员 · 用户信息'"></a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar1" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
    </form>
    <div class="collapse navbar-collapse" id="navbar1">
        <ul class="navbar-nav ml-auto">
            <li class="nav-item">
                <a class="btn ml-2 btn-outline-danger" href="/HTML/relogin">退出登录<span class="sr-only">(current)</span></a>
            </li>
            <form action="/HTML/searchUser" method="post" name="searchUser" >
                <button class="btn ml-2 btn-outline-danger" type="submit">用户列表<span class="sr-only"></span></button>
            </form>
            <form action="/HTML/adminShowOrderList" method="post" name="searchUser" >
                <button class="btn ml-2 btn-outline-primary" type="submit">订单列表<span class="sr-only"></span></button>
            </form>
        </ul>
    </div>
</nav>


<!--<div >-->
    <!--<p class="alert alert-success">点击订单号，可以更改对应订单的信息</p>-->
<!--</div> &lt;!&ndash; card.// &ndash;&gt;-->

<!-- ========================= SECTION CONTENT ========================= -->
<section class="section-content bg padding-y border-top">
    <div class="container">
        <p class="alert alert-success">若要修改用户信息，请在下方填写后修改。若要查看该用户订单，请在右方查看。若要查看订单详情，请点击订单号。</p>
        <p class="alert alert-danger">请在修改用户及其订单信息时保证修改正确</p>
        <div class="row">
            <form class="col-sm-3" action="/HTML/adminUpdateUserInfoTo" method="post" onsubmit="return judgePremission()">
                <h4 class="card-title mt-3 text-primary text-center" th:text="'— 用户'+${user.account}+'信息如下 —'"></h4>
                <hr>
                <input type="hidden" class="form-control"  name="user.account"th:value="${user.account}">
                <div class="form-group input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"> 姓名 </span>
                    </div>
                    <input type="text" class="form-control"name="user.name"  th:value="${user.name}">
                </div> <!-- form-group// -->
                <div class="form-group input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"> 性别 </span>
                    </div>
                    <input type="text" class="form-control" name="user.gender" th:value="${user.gender}">
                </div> <!-- form-group// -->
                <div class="form-group input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"> 年龄 </span>
                    </div>
                    <input type="text" class="form-control" name="user.age"th:value="${user.age}">
                </div> <!-- form-group// -->
                <div class="form-group input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"> 电话号码 </span>
                    </div>
                    <input type="text" class="form-control"  name="user.phone" th:value="${user.phone}">
                </div> <!-- form-group// -->
                <div class="form-group input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"> 邮箱</span>
                    </div>
                    <input type="text" class="form-control"  name="user.mail" th:value="${user.mail}">
                </div> <!-- form-group// -->
                <div class="form-group input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"> 角色</span>
                    </div>
                    <input type="text" class="form-control"  name="user.role"  th:value="${user.role}">
                </div> <!-- form-group// -->
                <div class="form-group input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"> 权限</span>
                    </div>
                    <input type="text" class="form-control" name="user.premission"th:value="${user.premission}">
                </div> <!-- form-group// -->
                <button type="submit"  class="btn btn-outline-success btn-block" >确认修改</button>
            </form>
            </aside> <!-- col.// -->
            <main class="col-sm-9">
                <div class="card">
                    <table class="table table-hover shopping-cart-wrap">
                        <thead class="text-muted">
                        <tr>
                            <th scope="col">订单号</th>
                            <th scope="col">酒店</th>
                            <th scope="col" >房间</th>
                            <th scope="col" >时间</th>
                            <th scope="col" >状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr  th:each="order: ${orders}">
                            <td>
                                <form action="/HTML/showOrderForAdmin" method="post" >
                                    <div class="price-wrap">
                                        <input type="hidden" name="orderId" id="orderId" th:value="${order.orderId}" >
                                        <button class="btn btn-outline-primary btn-sm" type="submit"
                                                data-toggle="tooltip" data-placement="top" title="点击订单号更改订单"
                                                th:text="${order.orderId}"></button>
                                    </div> <!-- price-wrap .// -->
                                </form>
                            </td>
                            <td>
                                <div class="price-wrap"><var class="text-muted" th:text="${order.hotelName}"></var></div> <!-- price-wrap .// -->
                            </td>
                            <td>
                                <div class="price-wrap"><var class="" th:text="'房号:'+${order.roomNumber}"></var></div> <!-- price-wrap .// -->
                                <div class="price-wrap"><var class="" th:text="'房型:'+${order.roomType}"></var></div> <!-- price-wrap .// -->
                            </td>
                            <td>
                                <div class="price-wrap"><var class="" th:text="${order.inTime}"></var></div> <!-- price-wrap .// -->
                                <div class="price-wrap"><var class="" th:text="'至 '+${order.outTime}"></var></div> <!-- price-wrap .// -->
                            </td>
                            <td>
                                <div class="price-wrap"><var class="" th:text="'支付:'+${order.paymentStatus}"></var></div> <!-- price-wrap .// -->
                                <div class="price-wrap"><var class="" th:text="'订单:'+${order.orderStatus}"></var></div> <!-- price-wrap .// -->
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div> <!-- card.// -->
            </main> <!-- col.// -->
        </div>

    </div> <!-- container .//  -->
</section>
<!-- ========================= SECTION CONTENT END// ========================= -->

<!-- ========================= FOOTER ========================= -->
<footer class="section-footer bg2">
    <div class="container">
        <section class="footer-bottom row">
            <div class="col-sm-6">
                <p> 四川大学实训项目 <br>  第六组作品</p>
            </div>
            <div class="col-sm-6">
                <p class="text-sm-right">
                    2019 · 7 · 8 <br>
                    中国 · 成都
                    <!--<a href="http://bootstrap-ecommerce.com">Bootstrap-ecommerce UI kit</a>-->
                </p>
            </div>
        </section> <!-- //footer-top -->
    </div><!-- //container -->
</footer>
<!-- ========================= FOOTER END // ========================= -->


</body>
</html>